<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/webjars/jquery/3.4.1/jquery.min.js"></script>
    <script>
        $(function () {
            $("#upload").click(function(){
                $("#uploadfile").click();
            });
        });
    </script>
</head>
<body>
<h1 th:text="${msg}"></h1>
<form action="/upload" method="post" enctype="multipart/form-data">
    <input type="file" name="projectheadpic" id="uploadfile" style="display: none" onchange="this.form.submit()">
    <input type="button" value="上传" id="upload">
</form>
<img th:src="${imgURL}" alt="">
</body>
</html>